<?php


namespace App\Models\Field;

class TopicField extends BaseField
{
    public const NOTE_DETAIL = 'noteDetail';

    public const DYNAMIC_LIST = 'dynamicList';

    public static function getFormats($scene = self::BASE_INFO): array

    {
        $baseFormats = [
            'id' => static function ($model) {
                return $model['topic_id'];
            },
            'description',
            'title',
            'type',
            'is_deleted',
            'updated_at',
        ];

        $formats = [
            self::NOTE_DETAIL => [
                'id' => static function ($model) {
                    return $model['topic_id'];
                },
                'title',
            ],
            self::DYNAMIC_LIST => [
                'id' => static function ($model) {
                    return $model['topic_id'];
                },
                'title',
                'updated_at'
            ],
        ];
        return $formats[$scene] ?? $baseFormats;
    }
}
